package com.niit.huodong1;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
import java.io.IOException;

public class NIITEmployeeMapper extends Mapper<LongWritable, Text, IntWritable,NIITEmployee>
    {
        @Override
        protected void map (LongWritable key,Text value,Context context)throws IOException,InterruptedException
        {
            String string = value.toString();
            String[] split = string.split(",");
            NIITEmployee person = new NIITEmployee(Integer.parseInt(split[0]),split[1],Integer.parseInt(split[2]),split[3]);
            context.write(person.getId(),person);
        }
    }

